<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        ul {
            list-style: none;
        }
        a{
            text-decoration: none;
            color: #666;
            font-size: 12px;
        }
        li {
            position: relative;
            float: left;
        }
        li > a{
            padding: 0 10px;
            border-right: 1px solid #ddd;
        }
        a:hover {
            color: orange;
        }
        .sub-nav {
            position: absolute;
            top: 30px;
            padding: 0 10px;
            border:1px solid #c0c0c0;
            border-top: 3px solid orange;
            display: none;
        }
        .sub-nav a {
            display: block;
            padding:0 10px;
            border-bottom: 1px solid #c0c0c0;
            text-align: center;
        }
        ul>li:hover .sub-nav {
            display: block;
        }
    </style>
</head>
<body>
    <ul>
        <li> <a href="">首页</a></li>
        <li> <a href="">菜单</a></li>
        <li> <a href="">栏目</a></li>
        <li>
             <a href="">下拉菜单</a>
             <div class="sub-nav">
                 <a href="">divcss</a>
                 <a href="">css特效</a>
                 <a href="">div css实例</a>
                 <a href="">html教程</a>
             </div>
        </li>
        <li> <a href="">栏目</a></li>
    </ul>
</body>
</html>